import React,{ Component } from "react";
import { Link, useNavigate, useParams, useLocation } from "react-router-dom"
function withRouter(Ss) {
    return (props) => (
        <Ss
            {...props}
            params={useParams()}
            location={useLocation()}
            navigate={useNavigate()}
        />
    )
}
class Home extends Component{

    render(){
        return (
        <div>
                <h1><Link to="/info/1">商品1</Link>  </h1>
                <h1><Link to="/info/2">商品2</Link></h1>
                <h1 onClick={() => this.props.navigate('/info/3')}>商品3</h1>
                <h1 onClick={() => this.props.navigate('/info/4')}>商品4</h1>
        </div>)
    }
}
export default withRouter(Home)